#include <iostream>

class Light
{
public:
    void open()
    {
        std::cout<<" 开灯 "<<std::endl;
    }
    void close()
    {
        std::cout<<" 关灯 "<<std::endl;
    }
};

class TV
{
public:
    void open()
    {
        std::cout<<" 开电视 "<<std::endl;
    }
    void close()
    {
        std::cout<<" 关电视 "<<std::endl;
    }
};
class Music
{
public:
    void open()
    {
        std::cout<<" 开音响 "<<std::endl;
    }
    void close()
    {
        std::cout<<" 关音响 "<<std::endl;
    }
};

/* 外观模式 */
class HomeSystem
{
    public:
    /* 设置函数调用方式 */
    void Sleep()
    {
        l.close();
        t.close();
        m.close();
    }
    void Movie()
    {
        l.close();
        t.open();
        m.open();
    }

private:
    Light l;
    TV t;
    Music m;
};

int main()
{
    HomeSystem h;
    h.Sleep();      //执行 关灯 关电视 关音响 

    return 0;
}